<template>
    <van-nav-bar
        title="推荐列表"
        left-arrow
        @click-left="$router.back()"
    />
    <div class="recoms-box">
        <recomend-card v-for="item in list" :key="item.id" :good="item"></recomend-card>
    </div>
</template>
<script>
import { ref } from 'vue'
import { getRecos } from '@/api'
import recomendCard from '@/components/recomendCard/recomendCard'
export default {
    components: {
        recomendCard
    },
    setup() {
        // 请求列表数据
        const list = ref([])
        getRecos().then(res => {
            list.value = res
        })

        return {
            list
        }
    }
}
</script>
<style lang="scss" scoped>
    .recoms-box {
        overflow: auto;
        height: calc(100% - 100px);
    }
</style>